Skip to content

Conversation

@mcol
Copy link
Contributor

@mcol mcol commented Oct 21, 2025

Fixes #2945.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.24%. Comparing base (a6769a6) to head (095a671).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2955   +/-   ##
=======================================
  Coverage   99.24%   99.24%           
=======================================
  Files         128      128           
  Lines        7291     7307   +16     
=======================================
+ Hits         7236     7252   +16     
  Misses         55       55           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcol
Copy link
Contributor Author

mcol commented Nov 28, 2025

I've changed the implementation so that we report a different message if sep is used in an expression(paste(...)), according to what noted in #2945 (comment).

R/paste_linter.R Outdated
#' )
#'
#' lint(
#' text = 'expression(paste("a", "b", sep = ""))',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in the "will produce lints" section; our approach generally is to "pair" linting expressions with their "clean" equivalents across the "top" and bottom (under "okay") parts of the documentation.

(it's a bit messy for this file in particular because paste_linter() does a lot)


if (!allow_empty_sep) {
## check if we are inside an expression()
expression_paste_sep_expr <- xml_find_all(paste_calls, expression_paste_sep_xpath)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks off -- what happens for something like this?

c(
  expression(paste(x, y, sep="")),
  paste(x, y, sep=""),
  expression(paste(a, b, sep="")),
  paste(a, b, sep="")
)

(generally xml_find_all() is 🚩 to me since it is not 1:1 -- for y = xml_find_all(x, ...), y[i] cannot predictably be associated with x[i] -- usually within linters we want to use xml_find_first())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

paste_linter should not warn inside expression() in a plot

2 participants